home *** CD-ROM | disk | FTP | other *** search
- function getCookie(name)
- {
- var cookieFound = false;
- var start = 0;
- var end = 0;
- var cookieString = document.cookie;
- var cookieValue;
-
- var i = 0;
-
- //scan the Cookie for the name
- while (i <= cookieString.length){
- start = i;
- end = start + name.length;
- if(cookieString.substring(start, end) == name){
- cookieFound = true;
- break;
- }
- i++;
- }
-
- //is name found/
- if(cookieFound){
- start = end+1;
- end = document.cookie.indexOf(";",start);
- if(end < start)
- end = document.cookie.length;
- cookieValue = document.cookie.substring(start, end);
- start = 0;
- end = cookieValue.indexOf(" ", start);
- if(end < start)
- end = cookieValue.length;
- return cookieValue.substring(start, end);
- }
- return "";
- }
-
- function initFields()
- {
- document.logon.userid.value = getCookie("IMail_UserId");
- document.logon.passwd.value = getCookie("IMail_password");
- }
-
- function deleteCookie(name, path, domain){
- if(getCookie(name)){
- document.cookie = name+ "=" +
- ((path) ? "; path=" + path : "") +
- ((domain) ? "; domain=" + domain: "") +
- "; expires=Thu, 01-Jan-70 00:00:01 GMT";
- }
- }
-
- function formSubmit()
- {
- deleteCookie("IMail_UserId", "/", null);
- deleteCookie("IMail_password", "/", null);
- deleteCookie("IMail_UserKey", "/", null);
- }
-